Optimal. Leaf size=143 \[ \frac{(-b e g+c d g+c e f)^2}{c^2 g^3 (2 c f-b g) (-b g+c f-c g x)}+\frac{(-b e g-c d g+3 c e f) (-b e g+c d g+c e f) \log (-b g+c f-c g x)}{c^2 g^3 (2 c f-b g)^2}+\frac{(e f-d g)^2 \log (f+g x)}{g^3 (2 c f-b g)^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.20921, antiderivative size = 143, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 42, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.048, Rules used = {798, 88} \[ \frac{(-b e g+c d g+c e f)^2}{c^2 g^3 (2 c f-b g) (-b g+c f-c g x)}+\frac{(-b e g-c d g+3 c e f) (-b e g+c d g+c e f) \log (-b g+c f-c g x)}{c^2 g^3 (2 c f-b g)^2}+\frac{(e f-d g)^2 \log (f+g x)}{g^3 (2 c f-b g)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 798
Rule 88
Rubi steps
\begin{align*} \int \frac{(d+e x)^2 (f+g x)}{\left (c f^2-b f g-b g^2 x-c g^2 x^2\right )^2} \, dx &=\int \frac{(d+e x)^2}{(f+g x) \left (\frac{c f^2-b f g}{f}-c g x\right )^2} \, dx\\ &=\int \left (\frac{(-e f+d g)^2}{g^2 (-2 c f+b g)^2 (f+g x)}+\frac{(3 c e f-c d g-b e g) (-c e f-c d g+b e g)}{c g^2 (2 c f-b g)^2 (c f-b g-c g x)}+\frac{(c e f+c d g-b e g)^2}{c g^2 (2 c f-b g) (-c f+b g+c g x)^2}\right ) \, dx\\ &=\frac{(c e f+c d g-b e g)^2}{c^2 g^3 (2 c f-b g) (c f-b g-c g x)}+\frac{(e f-d g)^2 \log (f+g x)}{g^3 (2 c f-b g)^2}+\frac{(3 c e f-c d g-b e g) (c e f+c d g-b e g) \log (c f-b g-c g x)}{c^2 g^3 (2 c f-b g)^2}\\ \end{align*}
Mathematica [A] time = 0.158546, size = 153, normalized size = 1.07 \[ \frac{\frac{\left (b^2 e^2 g^2-4 b c e^2 f g+c^2 \left (-d^2 g^2+2 d e f g+3 e^2 f^2\right )\right ) \log (-b g+c f-c g x)}{c^2 (b g-2 c f)^2}+\frac{(-b e g+c d g+c e f)^2}{c^2 (2 c f-b g) (c (f-g x)-b g)}+\frac{(e f-d g)^2 \log (f+g x)}{(b g-2 c f)^2}}{g^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.019, size = 449, normalized size = 3.1 \begin{align*}{\frac{\ln \left ( gx+f \right ){d}^{2}}{g \left ( bg-2\,cf \right ) ^{2}}}-2\,{\frac{\ln \left ( gx+f \right ) def}{{g}^{2} \left ( bg-2\,cf \right ) ^{2}}}+{\frac{\ln \left ( gx+f \right ){e}^{2}{f}^{2}}{ \left ( bg-2\,cf \right ) ^{2}{g}^{3}}}+{\frac{\ln \left ( cgx+bg-cf \right ){b}^{2}{e}^{2}}{g \left ( bg-2\,cf \right ) ^{2}{c}^{2}}}-4\,{\frac{\ln \left ( cgx+bg-cf \right ) b{e}^{2}f}{{g}^{2} \left ( bg-2\,cf \right ) ^{2}c}}-{\frac{\ln \left ( cgx+bg-cf \right ){d}^{2}}{g \left ( bg-2\,cf \right ) ^{2}}}+2\,{\frac{\ln \left ( cgx+bg-cf \right ) def}{{g}^{2} \left ( bg-2\,cf \right ) ^{2}}}+3\,{\frac{\ln \left ( cgx+bg-cf \right ){e}^{2}{f}^{2}}{ \left ( bg-2\,cf \right ) ^{2}{g}^{3}}}+{\frac{{b}^{2}{e}^{2}}{{c}^{2}g \left ( bg-2\,cf \right ) \left ( cgx+bg-cf \right ) }}-2\,{\frac{bde}{cg \left ( bg-2\,cf \right ) \left ( cgx+bg-cf \right ) }}-2\,{\frac{b{e}^{2}f}{c{g}^{2} \left ( bg-2\,cf \right ) \left ( cgx+bg-cf \right ) }}+{\frac{{d}^{2}}{g \left ( bg-2\,cf \right ) \left ( cgx+bg-cf \right ) }}+2\,{\frac{def}{ \left ( bg-2\,cf \right ){g}^{2} \left ( cgx+bg-cf \right ) }}+{\frac{{e}^{2}{f}^{2}}{{g}^{3} \left ( bg-2\,cf \right ) \left ( cgx+bg-cf \right ) }} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.04078, size = 362, normalized size = 2.53 \begin{align*} \frac{{\left (3 \, c^{2} e^{2} f^{2} + 2 \,{\left (c^{2} d e - 2 \, b c e^{2}\right )} f g -{\left (c^{2} d^{2} - b^{2} e^{2}\right )} g^{2}\right )} \log \left (c g x - c f + b g\right )}{4 \, c^{4} f^{2} g^{3} - 4 \, b c^{3} f g^{4} + b^{2} c^{2} g^{5}} + \frac{{\left (e^{2} f^{2} - 2 \, d e f g + d^{2} g^{2}\right )} \log \left (g x + f\right )}{4 \, c^{2} f^{2} g^{3} - 4 \, b c f g^{4} + b^{2} g^{5}} + \frac{c^{2} e^{2} f^{2} + 2 \,{\left (c^{2} d e - b c e^{2}\right )} f g +{\left (c^{2} d^{2} - 2 \, b c d e + b^{2} e^{2}\right )} g^{2}}{2 \, c^{4} f^{2} g^{3} - 3 \, b c^{3} f g^{4} + b^{2} c^{2} g^{5} -{\left (2 \, c^{4} f g^{4} - b c^{3} g^{5}\right )} x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.58895, size = 879, normalized size = 6.15 \begin{align*} \frac{2 \, c^{3} e^{2} f^{3} +{\left (4 \, c^{3} d e - 5 \, b c^{2} e^{2}\right )} f^{2} g + 2 \,{\left (c^{3} d^{2} - 3 \, b c^{2} d e + 2 \, b^{2} c e^{2}\right )} f g^{2} -{\left (b c^{2} d^{2} - 2 \, b^{2} c d e + b^{3} e^{2}\right )} g^{3} +{\left (3 \, c^{3} e^{2} f^{3} +{\left (2 \, c^{3} d e - 7 \, b c^{2} e^{2}\right )} f^{2} g -{\left (c^{3} d^{2} + 2 \, b c^{2} d e - 5 \, b^{2} c e^{2}\right )} f g^{2} +{\left (b c^{2} d^{2} - b^{3} e^{2}\right )} g^{3} -{\left (3 \, c^{3} e^{2} f^{2} g + 2 \,{\left (c^{3} d e - 2 \, b c^{2} e^{2}\right )} f g^{2} -{\left (c^{3} d^{2} - b^{2} c e^{2}\right )} g^{3}\right )} x\right )} \log \left (c g x - c f + b g\right ) +{\left (c^{3} e^{2} f^{3} - b c^{2} d^{2} g^{3} -{\left (2 \, c^{3} d e + b c^{2} e^{2}\right )} f^{2} g +{\left (c^{3} d^{2} + 2 \, b c^{2} d e\right )} f g^{2} -{\left (c^{3} e^{2} f^{2} g - 2 \, c^{3} d e f g^{2} + c^{3} d^{2} g^{3}\right )} x\right )} \log \left (g x + f\right )}{4 \, c^{5} f^{3} g^{3} - 8 \, b c^{4} f^{2} g^{4} + 5 \, b^{2} c^{3} f g^{5} - b^{3} c^{2} g^{6} -{\left (4 \, c^{5} f^{2} g^{4} - 4 \, b c^{4} f g^{5} + b^{2} c^{3} g^{6}\right )} x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] time = 4.84659, size = 770, normalized size = 5.38 \begin{align*} \frac{b^{2} e^{2} g^{2} - 2 b c d e g^{2} - 2 b c e^{2} f g + c^{2} d^{2} g^{2} + 2 c^{2} d e f g + c^{2} e^{2} f^{2}}{b^{2} c^{2} g^{5} - 3 b c^{3} f g^{4} + 2 c^{4} f^{2} g^{3} + x \left (b c^{3} g^{5} - 2 c^{4} f g^{4}\right )} + \frac{\left (d g - e f\right )^{2} \log{\left (x + \frac{\frac{b^{3} c g^{3} \left (d g - e f\right )^{2}}{\left (b g - 2 c f\right )^{2}} - \frac{6 b^{2} c^{2} f g^{2} \left (d g - e f\right )^{2}}{\left (b g - 2 c f\right )^{2}} + b^{2} e^{2} f g^{2} + \frac{12 b c^{3} f^{2} g \left (d g - e f\right )^{2}}{\left (b g - 2 c f\right )^{2}} - b c d^{2} g^{3} + 2 b c d e f g^{2} - 5 b c e^{2} f^{2} g - \frac{8 c^{4} f^{3} \left (d g - e f\right )^{2}}{\left (b g - 2 c f\right )^{2}} + 4 c^{2} e^{2} f^{3}}{b^{2} e^{2} g^{3} - 4 b c e^{2} f g^{2} - 2 c^{2} d^{2} g^{3} + 4 c^{2} d e f g^{2} + 2 c^{2} e^{2} f^{2} g} \right )}}{g^{3} \left (b g - 2 c f\right )^{2}} + \frac{\left (b e g - c d g - c e f\right ) \left (b e g + c d g - 3 c e f\right ) \log{\left (x + \frac{\frac{b^{3} g^{3} \left (b e g - c d g - c e f\right ) \left (b e g + c d g - 3 c e f\right )}{c \left (b g - 2 c f\right )^{2}} + b^{2} e^{2} f g^{2} - \frac{6 b^{2} f g^{2} \left (b e g - c d g - c e f\right ) \left (b e g + c d g - 3 c e f\right )}{\left (b g - 2 c f\right )^{2}} - b c d^{2} g^{3} + 2 b c d e f g^{2} - 5 b c e^{2} f^{2} g + \frac{12 b c f^{2} g \left (b e g - c d g - c e f\right ) \left (b e g + c d g - 3 c e f\right )}{\left (b g - 2 c f\right )^{2}} + 4 c^{2} e^{2} f^{3} - \frac{8 c^{2} f^{3} \left (b e g - c d g - c e f\right ) \left (b e g + c d g - 3 c e f\right )}{\left (b g - 2 c f\right )^{2}}}{b^{2} e^{2} g^{3} - 4 b c e^{2} f g^{2} - 2 c^{2} d^{2} g^{3} + 4 c^{2} d e f g^{2} + 2 c^{2} e^{2} f^{2} g} \right )}}{c^{2} g^{3} \left (b g - 2 c f\right )^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.10741, size = 401, normalized size = 2.8 \begin{align*} -\frac{{\left (c^{2} d^{2} g^{2} - 2 \, c^{2} d f g e - 3 \, c^{2} f^{2} e^{2} + 4 \, b c f g e^{2} - b^{2} g^{2} e^{2}\right )} \log \left ({\left | c g x - c f + b g \right |}\right )}{4 \, c^{4} f^{2} g^{3} - 4 \, b c^{3} f g^{4} + b^{2} c^{2} g^{5}} + \frac{{\left (d^{2} g^{2} - 2 \, d f g e + f^{2} e^{2}\right )} \log \left ({\left | g x + f \right |}\right )}{4 \, c^{2} f^{2} g^{3} - 4 \, b c f g^{4} + b^{2} g^{5}} - \frac{2 \, c^{3} d^{2} f g^{2} - b c^{2} d^{2} g^{3} + 4 \, c^{3} d f^{2} g e - 6 \, b c^{2} d f g^{2} e + 2 \, b^{2} c d g^{3} e + 2 \, c^{3} f^{3} e^{2} - 5 \, b c^{2} f^{2} g e^{2} + 4 \, b^{2} c f g^{2} e^{2} - b^{3} g^{3} e^{2}}{{\left (c g x - c f + b g\right )}{\left (2 \, c f - b g\right )}^{2} c^{2} g^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]